package toanstt.gameplay;

import toanstt.com.T;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;



public class Comment 
{
	String[] commnet_strs; 
	int index ;
	int count;
	int x, y;
	Paint paint;
	int socore;
	
	Comment()
	{
		commnet_strs = new String[6];
		commnet_strs[0] = "Cool";
		commnet_strs[1] = "Good";
		commnet_strs[2] = "Perfect";
		commnet_strs[3] = "Excellent";
		commnet_strs[4] = "Oh my God";
		commnet_strs[5] = "Oh no!";
		x = y = 100;
		paint = new Paint();
		paint.setColor(Color.DKGRAY);
		paint.setTextSize(40);
	}
	public void Draw(Canvas canvas)
	{
		if(count >0)
		{
			
			count--;
			if(index != -1)
			{
				if(index==5)
					T.bitmapFont_large[4].drawString(canvas,commnet_strs[index] , x, y, 2,true);
				else
					T.bitmapFont_large[index].drawString(canvas,commnet_strs[index] , x, y, 2,true);
			}
			//canvas.drawText(""+socore, x+20, y+50, paint);
			if(socore>0)
				T.bitmapFont_large[0].drawString(canvas,"+"+socore , x+20, y+50, 2,true);
			else
				T.bitmapFont_large[0].drawString(canvas,""+socore , x+20, y+50, 2,true);
			
		}
	}
	public void DoComment(int soc,int x1,int y1)
	{
		x = x1;
		y =y1;
		count = 15;
		socore = soc;
		index = -1;
		T.bitmapFont_large[0].DoRandomScale();
		T.bitmapFont_large[1].DoRandomScale();
		T.bitmapFont_large[2].DoRandomScale();
		T.bitmapFont_large[3].DoRandomScale();
		T.bitmapFont_large[4].DoRandomScale();
		T.bitmapFont_large[5].DoRandomScale();
		
		if(soc>1000)
		{
			T.PLAY_GOLD+= soc/2;
			index = 4;
			//T.bitmapFont_large[4].DoRandomScale();
			//T.paint_comment.setColor(Color.RED);
			//T.paint_comment.setTextSize(75);
		}
		else if(soc>800)
		{
			T.PLAY_GOLD+= soc/2;
			index = 3;
			//T.bitmapFont_large[3].DoRandomScale();
			//T.paint_comment.setColor(Color.RED);
			//T.paint_comment.setTextSize(65);
		}
		else if(soc>600)
		{
			T.PLAY_GOLD+= soc/2;
			index = 2;
			//T.bitmapFont_large[2].DoRandomScale();
			//T.paint_comment.setColor(Color.YELLOW);
			//T.paint_comment.setTextSize(60);
		} 
		else if(soc>400)
		{
			T.PLAY_GOLD+= soc/2;
			index = 1;
			//T.bitmapFont_large[1].DoRandomScale();
			//T.paint_comment.setColor(Color.BLUE);
			//T.paint_comment.setTextSize(55);
		} 
		else if(soc>200)
		{
			T.PLAY_GOLD+= soc/2;
			index = 0;
			//T.bitmapFont_large[0].DoRandomScale();
			//T.paint_comment.setColor(Color.GREEN);
			//T.paint_comment.setTextSize(50);
		}
		else if(soc<0)
		{
			index = 5;
			//T.PLAY_GOLD+= soc/2;
			//T.bitmapFont_large[5].DoRandomScale();
			//T.paint_comment.setColor(Color.RED);
			//T.paint_comment.setTextSize(50);
		}
		
		
	}
}
